﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using Newtonsoft.Json;
using IRongs.Wbt.Common.Auth;

namespace IRongs.Wbt.Processor
{
    class Program
    {
        static void Main(string[] args)
        {
            //SinaOAuth sina = new SinaOAuth();
            //sina.Token = "b3bd504bbb3fec4bf3a849d4e954cedd";
            //sina.TokenSecret = "2ecaf2f94bb4708bef21fe6cc70e88be";
            //sina.UserId = "1650049270";
            //sina.Verifier = "471814";
            ////string accessTokenUrl = sina.GetRequestToken();

            ////System.Diagnostics.Process.Start(accessTokenUrl + "&oauth_callback=oob");

            ////string temp = string.Empty;

            ////sina.GetAccessToken(temp);


            //string temp2 = sina.OAuthWebRequest("http://api.t.sina.com.cn/users/show.json?user_id=" + sina.UserId, string.Empty, Method.GET);

            //object obj = JsonConvert.DeserializeObject(temp2);

            ////string posted = sina.OAuthWebRequest("http://api.t.sina.com.cn/statuses/update.json", "status=测试#艾榕#微博通客户端", Method.POST);

            //DestopProfile profile = new DestopProfile("1", "艾榕");
            //profile = DestopProfile.GetProfile(profile.ProfilePath);

            //IOAuthable sina = null;
            //if (profile != null)
            //{
            //    sina = profile.OAuth;
            //}
            //else
            //{
            //    sina = new SinaOAuth();

            //    string accessTokenUrl = sina.GetRequestToken();

            //    Console.WriteLine(accessTokenUrl);

            //    string verifier = string.Empty;
            //    sina.GetAccessToken(verifier);

            //    profile = new DestopProfile("1", "艾榕");
            //    profile.OAuth = sina;
            //    profile.Save();
            //}

            //string temp = sina.SendRequest("http://api.t.sina.com.cn/users/show.json?user_id=" + sina.UserId, Method.GET, null);

            //string posted = sina.SendRequest("http://api.t.sina.com.cn/statuses/update.json", Method.POST, new List<QueryParameter> { new QueryParameter("status", "#艾榕#测试微博通客户端") });

            //Console.ReadKey();
        }
    }
}
